chrome.browserAction.onClicked.addListener( function( tab ) {
	chrome.tabs.create( {'url': chrome.extension.getURL( 'tab.html' )} );
});

var oauth = ChromeExOAuth.initBackgroundPage( {
	'request_url': 'https://www.google.com/accounts/OAuthGetRequestToken',
	'authorize_url': 'https://www.google.com/accounts/OAuthAuthorizeToken',
	'access_url': 'https://www.google.com/accounts/OAuthGetAccessToken',
	'consumer_key': 'anonymous',
	'consumer_secret': 'anonymous',
	'scope': 'https://www.google.com/m8/feeds/',
	'app_name': 'Gmail Contact Formatter'
});

console.log( 'ChromeExOAuth.initBackgroundPage()' );

function Authorize( callback ) {
	oauth.authorize( callback );
}

function SendSignedRequest( feed, callback, params ) {
	oauth.sendSignedRequest( feed, callback, { 'parameters': params } );
}

function IsLoggedIn() {
	return oauth.hasToken;
}